<?php
header('Content-Type: application/json');
require('init.php');
$sql = "SELECT * FROM fs_notice";
$result = mysqli_query($conn,$sql);
if (!$result) {
            printf("Error: %s\n", mysqli_error($conn));
            exit();
        }
$list = mysqli_fetch_all($result, MYSQLI_ASSOC);
if($list == null){
    $error='{"code":-1,"msg":"获取公告失败！"}';
    echo $error;
}

echo json_encode($list);